{extend name='admin@main'}

{block name="content"}

{include file='store@state/form_style'}

<form onsubmit="return false;" id="GoodsForm" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">

    <div class="layui-card-body think-box-shadow padding-left-40" >

        <div class="layui-form-item layui-row layui-col-space15" >

            <label class="layui-col-xs9 relative" style="width:30%">
                <span class="color-green">车位名称</span>
                <input name="name" required class="layui-input" placeholder="请输入车位名称" value="{$vo.name|default=''}">
            </label>
            <label class="layui-col-xs9 relative" style="width:30%">
                <span class="color-green">车位编号</span>
                <input name="sn" required class="layui-input" placeholder="请输入车位编号" value="{$vo.sn|default=''}">
            </label>

            <label class="layui-col-xs9 relative" style="width:30%">
                <span class="color-green">车位价格(元/小时)</span>
                <input name="price" required class="layui-input" placeholder="请输入车位价格" value="{$vo.price|default=''}">
            </label>

            <label class="layui-col-xs9 relative" style="width:30%">
                <span class="color-green">如何获取经纬度？</span>
                <a target="_blank" href="{:sysconf('relam_name')}/map.html"><input style="cursor: pointer" readonly type="button" class="layui-input" placeholder="打开高德地图" value="打开高德地图"></a>
            </label>


            <label class="layui-col-xs9 relative" style="width:30%">
                <span class="color-green">纬度</span>
                <input name="lat" required class="layui-input" placeholder="请输入纬度" value="{$vo.lat|default=''}">
            </label>

            <label class="layui-col-xs9 relative" style="width:30%">
                <span class="color-green">经度</span>
                <input name="lng" required class="layui-input" placeholder="请输入经度" value="{$vo.lng|default=''}">
            </label>

            <label class="layui-col-xs9 relative" style="width:30%">
                <span class="color-green">备注详情</span>
                <input name="remark" required class="layui-input" placeholder="请输入备注详情" value="{$vo.remark|default=''}">
            </label>

            <label class="layui-col-xs9 relative" style="width:30%">
                <span class="color-green">营业开始时间</span>
                <input type="time" name="start_time" required class="layui-input" placeholder="请输入营业开始时间" value="{$vo.start_time|default=''}">
            </label>

            <label class="layui-col-xs9 relative" style="width:30%">
                <span class="color-green">营业结束时间</span>
                <input type="time" name="end_time" required class="layui-input" placeholder="请输入营业结束时间" value="{$vo.end_time|default=''}">
            </label>

            <label class="layui-col-xs9 relative" style="width:30%">
                <span class="color-green">营业开始时间2</span>
                <input type="time" name="start_time2"  class="layui-input" placeholder="请输入营业开始时间2" value="{$vo.start_time2|default=''}">
            </label>

            <label class="layui-col-xs9 relative" style="width:30%">
                <span class="color-green">营业结束时间2</span>
                <input type="time" name="end_time2"  class="layui-input" placeholder="请输入营业结束时间2" value="{$vo.end_time2|default=''}">
            </label>

            <label class="layui-col-xs9 relative" style="width:30%">
                <span class="color-green">营业开始时间3</span>
                <input type="time" name="start_time3"  class="layui-input" placeholder="请输入营业开始时间3" value="{$vo.start_time3|default=''}">
            </label>

            <label class="layui-col-xs9 relative" style="width:30%">
                <span class="color-green">营业结束时间3</span>
                <input type="time" name="end_time3"  class="layui-input" placeholder="请输入营业结束时间3" value="{$vo.end_time3|default=''}">
            </label>

            <label class="layui-col-xs3 relative" style="width:30%">
                <span class="color-green">状态</span>
                <select style="width: 100%" name='status' required class='layui-select' lay-search>
                    {foreach [['id'=>'1','title'=>'正常'],['id'=>'2','title'=>'故障'],['id'=>'3','title'=>'被使用'],['id'=>'4','title'=>'停用']] as $cate}
                    {if isset($vo.status) and $vo.status eq $cate.title}
                    <option selected value="{$cate.id}">{$cate.title|default=''}</option>
                    {else}
                    <option value="{$cate.id}">{$cate.title|default=''}</option>
                    {/if}
                    {/foreach}
                </select>
            </label>



            <label class="layui-col-xs3 relative" style="width:30%">
                <span class="color-green">电站列表</span>
                <select style="width: 95%" name='station_id' required class='layui-select' lay-search>
                    {foreach $station_list as $cate}
                    {if isset($vo.station_id) and $vo.station_id eq $cate.id}
                    <option selected value="{$cate.id}">{$cate.name|default=''}</option>
                    {else}
                    <option value="{$cate.id}">{$cate.name|default=''}</option>
                    {/if}
                    {/foreach}
                </select>
            </label>

        </div>

        <div class="layui-form-item">
            <span class="color-green label-required-prev">图片</span>
            <table class="layui-table">
                <thead>
                <tr>
                    <th class="text-left">图片</th>
                    <th class="text-left" style="display:none;">导航图</th>
                    <th class="text-left">展示图片</th>
                </tr>
                <tr>
                    <td width="90px" class="text-left"><input name="pic" type="hidden" value="{$vo.pic|default=''}"></td>
                    <td width="90px" class="text-left" style="display:none;"><input name="map_image" type="hidden" value="{$vo.map_image|default=''}"></td>
                    <td width="auto" class="text-left"><input name="images" type="hidden" value="{$vo.images|default=''}"></td>
                </tr>
                </thead>
            </table>
            <script>$('[name="pic"]').uploadOneImage(),$('[name="map_image"]').uploadMultipleImage(), $('[name="images"]').uploadMultipleImage()</script>
        </div>

        <div class="layui-form-item text-center">
            {notempty name='vo.id'}<input type="hidden" name="id" value="{$vo.id}">{/notempty}
            <button class="layui-btn layui-btn-danger" ng-click="hsitoryBack()" type="button">取消编辑</button>
            <button class="layui-btn" type="submit">保存</button>
        </div>

    </div>
</form>
{/block}

{block name='script'}
<script>
    window.form.render();

</script>

{/block}